class Review < ActiveRecord::Base
  has_many :ratings, :dependent => :destroy
  has_many :rating_criterions, :through=>:ratings
  belongs_to :review_type
    
  def custom_ratings
      ratings.select{|rating|
        not rating.rating_criterion.overall?
      }
  end

  def overall_rating
      ratings.find{|rating|
        rating.rating_criterion.overall?
      }
  end
end
